package com.bootdo.program;

import cn.hutool.core.io.FileUtil;

import java.io.*;
import java.util.ArrayList;

/**
 * @author guoyunfei on 2021/7/31 16:59
 * @className TestFile
 * @description TODO
 * @Version 1.0
 */
public class TestFile {


    public static void main(String[] args) {


        ArrayList<String> arrayList = new ArrayList<>();
        try {
            File file = new File("C:\\Users\\guoyunfei\\Desktop\\2021.txt");
            InputStreamReader inputReader = new InputStreamReader(new FileInputStream(file),"UTF-8");
            BufferedReader bf = new BufferedReader(inputReader);
            // 按行读取字符串
            String str;

            while ((str = bf.readLine()) != null) {
                String[] split = str.split(",");
                String s = split[0].replaceAll("\"", "");
                System.out.println(s);
                String s1 = FileUtil.extName(s);
                if("jpg".equals(s1) || "png".equals(s1)){
                    arrayList.add(s);
                }
            }
            bf.close();
            inputReader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }





}
